/*
 * @Description:
 * @version:
 * @Author: 尹鹏孝
 * @Date: 2022-12-19 16:09:34
 * @LastEditors: 尹鹏孝
 * @LastEditTime: 2022-12-19 16:50:04
 */
import { ref} from 'vue'
import { useEventListener } from './event'
export function useMouse () {
    const x = ref(0)
    const y = ref(0)
    function update(event:any) {
        x.value = event.pageX
        y.value = event.pageY
    }
    useEventListener(window, 'mousemove', update)
    return {x,y}
}